<?php

class Test extends BaseTest
{
  public function __toString()
  {
    return  $this->name;
  }
  public function getQuestionsLevel($level)
  {
      $c = new Criteria();
      $c->add(QuestionPeer::LEVEL, $level);
      return  QuestionPeer::doSelect($c);
  }
  public function getMark($count)
  {
    $result = array();
    if($count >= 90)
    {
        $result['5b'] = 5;
    }
    elseif($count >= 75)
    {
        $result['5b'] = 4;
    }
    elseif($count >= 60)
    {
        $result['5b'] = 3;
    }
    elseif($count >= 35)
    {
        $result['5b'] = 2;
    }
    else $result['5b'] = 1;

    if($count >= 90)
    {
        $result['ects'] = 'A';
    }
    elseif($count >= 82)
    {
        $result['ects'] = 'B';
    }
    elseif($count >= 75)
    {
        $result['ects'] = 'C';
    }
    elseif($count >= 68)
    {
        $result['ects'] = 'D';
    }
    elseif($count >= 60)
    {
        $result['ects'] = 'E';
    }
    elseif($count >= 35)
    {
        $result['ects'] = 'FX';
    }
    else $result['ects'] = 'F';

    if($count >= 90)
    {
        $result['zalik'] = 'Зараховано';
    }
    elseif($count >= 75)
    {
        $result['zalik'] = 'Зараховано';
    }
    elseif($count >= 60)
    {
        $result['zalik'] = 'Зараховано';
    }
    elseif($count >= 35)
    {
        $result['zalik'] = 'Незараховано';
    }
    else $result['zalik'] = 'Незараховано';

    if($count >= 98)
    {
        $result['12b'] = 12;
    }
    elseif($count >= 94)
    {
        $result['12b'] = 11;
    }
    elseif($count >= 90)
    {
        $result['12b'] = 10;
    }
    elseif($count >= 87)
    {
        $result['12b'] = 9;
    }
    elseif($count >= 81)
    {
        $result['12b'] = 8;
    }
    elseif($count >= 75)
    {
        $result['12b'] = 7;
    }
    elseif($count >= 67)
    {
        $result['12b'] = 6;
    }
    elseif($count >= 61)
    {
        $result['12b'] = 5;
    }
    elseif($count >= 55)
    {
        $result['12b'] = 4;
    }
    elseif($count >= 47)
    {
        $result['12b'] = 3;
    }
    elseif($count >= 41)
    {
        $result['12b'] = 2;
    }
    else $result['12b'] = 1;

    return $result;
  }
}
